package sctu.edu.java.year2016.team01.xuhanmei.day20160524.practice4;

/**
 * Created by Administrator on 2016/5/24.
 */
public class HuiWen {
    public static void main(String[] args) {
        String str1 = "这首《咏雪》";
        StringBuilder str2 = new StringBuilder(str1);
        str2.reverse();


        int count = 0;


        for (int i = 0; i < str1.length(); i++) {
            if (str1.charAt(i) != str2.charAt(i)) {
                System.out.println("str1不是回文诗！");
                break;
            }
            if (str1.charAt(i) == str2.charAt(i)) {
                count++;
            }
        }
        if (count == str1.length()) {
            System.out.println("str1是回文诗！");
        }
    }
}
